<template>
  <div class="dashboard-container">
    <div class="dashboard-text">欢迎登录:{{ name}}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import {getCookie} from '@/utils/cookie'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'username'
    ])
  },
  data () {
    return {
      name: ''
    }
  },
  created () {
    // console.log("===============  "+this.username,getCookie('username'))
    this.name = this.username ? this.username : getCookie('username')
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
